Optimal. Leaf size=90 \[ \frac {3 i x}{2 a}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}-\frac {2 \log (\sin (c+d x))}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3633, 3610,
3612, 3556} \begin {gather*} -\frac {\cot ^2(c+d x)}{a d}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {2 \log (\sin (c+d x))}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {3 i x}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3610
Rule 3612
Rule 3633
Rubi steps
\begin {align*} \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx &=\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot ^3(c+d x) (-4 a+3 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac {\cot ^2(c+d x)}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot ^2(c+d x) (3 i a+4 a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot (c+d x) (4 a-3 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {3 i x}{2 a}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {2 \int \cot (c+d x) \, dx}{a}\\ &=\frac {3 i x}{2 a}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}-\frac {2 \log (\sin (c+d x))}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(414\) vs. \(2(90)=180\).
time = 0.95, size = 414, normalized size = 4.60 \begin {gather*} \frac {\csc \left (\frac {c}{2}\right ) \csc ^2(c+d x) \sec \left (\frac {c}{2}\right ) \sec (c+d x) \left (-3 \cos (2 c+d x)+6 i d x \cos (2 c+d x)+7 \cos (2 c+3 d x)+2 i d x \cos (2 c+3 d x)+\cos (4 c+3 d x)-2 i d x \cos (4 c+3 d x)+\cos (d x) \left (-5-6 i d x-12 \log \left (\sin ^2(c+d x)\right )\right )+12 \cos (2 c+d x) \log \left (\sin ^2(c+d x)\right )+4 \cos (2 c+3 d x) \log \left (\sin ^2(c+d x)\right )-4 \cos (4 c+3 d x) \log \left (\sin ^2(c+d x)\right )-25 i \sin (d x)+2 d x \sin (d x)-4 i \log \left (\sin ^2(c+d x)\right ) \sin (d x)+64 \text {ArcTan}(\tan (d x)) \sin (c) (\cos (c+d x)+i \sin (c+d x)) \sin ^2(c+d x)+i \sin (2 c+d x)-2 d x \sin (2 c+d x)+4 i \log \left (\sin ^2(c+d x)\right ) \sin (2 c+d x)+9 i \sin (2 c+3 d x)-2 d x \sin (2 c+3 d x)+4 i \log \left (\sin ^2(c+d x)\right ) \sin (2 c+3 d x)-i \sin (4 c+3 d x)+2 d x \sin (4 c+3 d x)-4 i \log \left (\sin ^2(c+d x)\right ) \sin (4 c+3 d x)\right )}{64 a d (-i+\tan (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 77, normalized size = 0.86
method | result | size |
derivativedivides | \(\frac {\frac {i}{2 \tan \left (d x +c \right )-2 i}+\frac {7 \ln \left (\tan \left (d x +c \right )-i\right )}{4}-\frac {1}{2 \tan \left (d x +c \right )^{2}}+\frac {i}{\tan \left (d x +c \right )}-2 \ln \left (\tan \left (d x +c \right )\right )+\frac {\ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(77\) |
default | \(\frac {\frac {i}{2 \tan \left (d x +c \right )-2 i}+\frac {7 \ln \left (\tan \left (d x +c \right )-i\right )}{4}-\frac {1}{2 \tan \left (d x +c \right )^{2}}+\frac {i}{\tan \left (d x +c \right )}-2 \ln \left (\tan \left (d x +c \right )\right )+\frac {\ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(77\) |
risch | \(\frac {7 i x}{2 a}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )}}{4 d a}+\frac {4 i c}{d a}+\frac {2}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a d}\) | \(77\) |
norman | \(\frac {-\frac {\tan ^{2}\left (d x +c \right )}{d a}+\frac {i \tan \left (d x +c \right )}{d a}-\frac {1}{2 d a}+\frac {3 i x \left (\tan ^{2}\left (d x +c \right )\right )}{2 a}+\frac {3 i x \left (\tan ^{4}\left (d x +c \right )\right )}{2 a}+\frac {3 i \left (\tan ^{3}\left (d x +c \right )\right )}{2 d a}}{\tan \left (d x +c \right )^{2} \left (1+\tan ^{2}\left (d x +c \right )\right )}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d a}-\frac {2 \ln \left (\tan \left (d x +c \right )\right )}{d a}\) | \(143\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 134, normalized size = 1.49 \begin {gather*} \frac {14 i \, d x e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (-28 i \, d x - 1\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, {\left (-7 i \, d x - 5\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 8 \, {\left (e^{\left (6 i \, d x + 6 i \, c\right )} - 2 \, e^{\left (4 i \, d x + 4 i \, c\right )} + e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) - 1}{4 \, {\left (a d e^{\left (6 i \, d x + 6 i \, c\right )} - 2 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.23, size = 138, normalized size = 1.53 \begin {gather*} \begin {cases} - \frac {e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: a d e^{2 i c} \neq 0 \\x \left (\frac {\left (7 i e^{2 i c} + i\right ) e^{- 2 i c}}{2 a} - \frac {7 i}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {2}{a d e^{4 i c} e^{4 i d x} - 2 a d e^{2 i c} e^{2 i d x} + a d} + \frac {7 i x}{2 a} - \frac {2 \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.80, size = 105, normalized size = 1.17 \begin {gather*} \frac {\frac {\log \left (\tan \left (d x + c\right ) + i\right )}{a} + \frac {7 \, \log \left (i \, \tan \left (d x + c\right ) + 1\right )}{a} - \frac {8 \, \log \left (\tan \left (d x + c\right )\right )}{a} - \frac {7 \, \tan \left (d x + c\right ) - 9 i}{a {\left (\tan \left (d x + c\right ) - i\right )}} + \frac {2 \, {\left (6 \, \tan \left (d x + c\right )^{2} + 2 i \, \tan \left (d x + c\right ) - 1\right )}}{a \tan \left (d x + c\right )^{2}}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.97, size = 110, normalized size = 1.22 \begin {gather*} \frac {7\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}{4\,a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{4\,a\,d}-\frac {2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a\,d}-\frac {\frac {1}{2\,a}+\frac {3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,a}-\frac {\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}{2\,a}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________